Hyper-V Network Virtualization Cookbook by Ryan Boud
Author:Ryan Boud [Boud, Ryan]
Language: eng
Format: epub, pdf
Publisher: Packt Publishing
Published: 2014-11-27T22:00:00+00:00
It is important to know which network adapter is connected to which network interface. In the wizard, there are the following three Ethernet adapters listed at the moment:Ethernet2
Ethernet3
Ethernet4
None of these are particularly useful. The following PowerShell script will obtain all the information about the gateway VM from VMM, determine the VM Networks each NIC is attached to and rename the NIC in the VM with the appropriate name. The code is as follows:
#Hashtable of VM Networks and the names the NICs should be inside the Gateway VM $NicNames =@{ "Host-Management" ="Management"; "External (NAT)" ="External"; "" ="TenantNetworks" } #Get the VM from VMM, not from Hyper-V $GatewayVM = Get-SCVirtualMachine -Name HNVGateway1 #Iterate through each entry in the Hashtable ForEach($Key in $NicNames.Keys){ #Find the Network Adapter's MAC Address in VMM that is connected to #the VM Network. As the Tenant Network Adapter is not attached to a #VM Network it must be dealt with carefully $VNAMacAddress = ($GatewayVM.VirtualNetworkAdapters | Where-Object{ #Check for an actual value if($_.VMNetwork.Name){ if($_.VMNetwork.Name -eq $key){ $True } } #check for the Tenant NIC elseif(!($_.VMNetwork.Name) -and !($key)){ $True } }).MACAddress Invoke-Command -ComputerName $GatewayVM.ComputerName -ScriptBlock { Param($LocalMacAddress, $NewNicName) #Change the format of the MAC Address $LocalMacAddress = $LocalMacAddress -replace ":","-" #Find the NIC based on the MAC address obtained from VMM $NIC = Get-NetAdapter | Where-Object { $_.MacAddress -eq $LocalMacAddress} #Get the WMI object based on the NIC's current name $wmi = Get-WmiObject -Class Win32_NetworkAdapter -Filter "NetConnectionID = ""$($NIC.Name)""" #Change the NIC's name to the correct name $wmi.NetConnectionID = $NewNicName $wmi.Put() } -ArgumentList $VNAMacAddress,$NicNames.Item($Key) }
Download
Hyper-V Network Virtualization Cookbook by Ryan Boud.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12957)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10397)
Hello! Python by Anthony Briggs(10200)
The Mikado Method by Ola Ellnestam Daniel Brolund(10108)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(10044)
Dependency Injection in .NET by Mark Seemann(9582)
Hit Refresh by Satya Nadella(9017)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8589)
The Kubernetes Operator Framework Book by Michael Dame(8383)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8186)
Robo-Advisor with Python by Aki Ranin(8142)
Practical Computer Architecture with Python and ARM by Alan Clements(8123)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8103)
Svelte with Test-Driven Development by Daniel Irvine(7993)
Building Low Latency Applications with C++ by Sourav Ghosh(7993)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7969)
Grails in Action by Glen Smith Peter Ledbrook(7942)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7912)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7900)